import { stringify } from 'qs';
import request from '../utils/request';

/*利用json-server数据*/
export async function employelist() {
  //查列表数据
  return request('http://localhost:3000/employe', {
    method: 'GET',
  });
}
export async function employeDetail(params) {
  //详情数据
  return request(`http://localhost:3000/employe/${params}`, {
    method: 'GET',
  });
}
export async function removeemploye(params) {
  //删除数据
  return request('http://localhost:3000/employe/' + params, {
    method: 'DELETE',
  });
}
export async function updateEmploye(id, values) {
  //修改数据
  return request(`http://localhost:3000/employe/${id}`, {
    method: 'PATCH',
    body: values,
  });
}
export async function createmploye(params) {
  //增添数据
  return request('http://localhost:3000/employe', {
    method: 'POST',
    body: params,
  });
}
//关键字检索
export async function queryEmploye (params) {
  //表单条件查询
  return request(`http://localhost:3000/employe?${stringify(params)}`, {
    method: 'GET',
  });
} 
